import React, { Component, useEffect, useState } from 'react'
//  推荐将 BrowserRouter 重命名为 Router
import { Router, Route, Switch } from 'react-router-dom'

// import Login from './pages/Login'/
// import Layout from './pages/Layout'
// import AuthRouter from './Components/AuthRouter'
// import history from './utils/history'
// export default class App extends Component {
//   render() {
//     return <Router history = {history}>
//       {/* React 路由中，默认是不会匹配到第一个就停止匹配 */}
//       {/* Switch负责匹配到第一个组件后，就不再向后匹配 */}
//       <Switch>
//         <Route path="/login" component={Login}></Route>
//         <AuthRouter path="/" component={Layout}></AuthRouter>
//       </Switch>
//     </Router>
    
//   }
// }

import request from "./utils/request"
export default function App() {

  const [list, setList] = useState([])
  async function loadList() {
    const res = await request({ url: '/v1_0/channels' })
    console.log('res  ----->  ', res.data.channels);
    setList(res.data.channels)
  }

  useEffect(() => {
    loadList()
  }, [])

  return (
    <div>
      
    </div>
  )
}






